<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>假装是个破解版的人人视频</title>
	<meta name="referrer" content="never">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
	<body>
		<div id="img_div">
			<img id="img_info" src="" width="100%" />
		</div>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend id="title">稍等一下下啦</legend>
			<div id="info">
			</div>
		</fieldset>
		<script src="/layui/layui.js" charset="utf-8"></script>
		<script>
			//注意：折叠面板 依赖 element 模块，否则无法进行功能性操作
			layui.use('element', function() {
				var element = layui.element;
				var $ = layui.jquery;
				var aid = getRequest().aid;
				$.get('/rr/getVideoInfo?id=' + aid, function(res) {
					res = JSON.parse(res);
					var str = '<div class="layui-collapse">';
					layui.each(res.data.list, function(index, item) {
						$("#title").html(res.data.detail.cnname);
						layui.each(item.episodes, function(index1, item1) {
							str += '<div class="layui-colla-item"><h2 class="layui-colla-title">' + item1.episode_name + '</h2><div class="layui-colla-content">';
							layui.each(item1.files.MP4, function(index2, item2) {
								str += '<div class="layui-form-item"><label class="layui-form-label"><a href="' + item2.address + '">' + item2.way_name + '</a></label><div class="layui-input-block"><input  class="layui-input" value="' + item2.address + '" ></div></div>';
							});
							str += '</div></div>';
						});
					});
					$("#info").html(str);
					element.render();
				});
			});

			function getRequest() {
				var url = location.search; //获取url中"?"符后的字串
				var theRequest = new Object();
				if(url.indexOf("?") != -1) {
					var str = url.substr(1);
					strs = str.split("&");
					for(var i = 0; i < strs.length; i++) {
						theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
					}
				}
				return theRequest;
			}
		</script>

	</body>

</html>